package com.lanyou.cook.upload.service.socket.delfile;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;

import org.apache.log4j.Logger;

public class FileCilent {
	private static Logger logger = Logger.getLogger(FileCilent.class);  
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		logger.info("test");
		Socket client = null;
		try {
			client = new Socket("172.26.153.196", 8887);
			OutputStream os = client.getOutputStream();
			InputStream is = client.getInputStream();
			os.write("配置脚本.txt".getBytes("utf-8"));
			byte[] b = new byte[1024]; 
			is.read(b);
			os.close();
			is.close();
			System.out.println("send over");
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {

			try {
				client.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

}
